package com.panfeng.xcloud.boss.provider.rpc.fallback;

import com.alibaba.fastjson.JSON;
import com.panfeng.xcloud.boss.provider.dto.request.OperateBotReqDTO;
import com.panfeng.xcloud.boss.provider.rpc.assets.ExecuteOrderServiceFeignApi;
import com.panfeng.xcloud.common.core.web.vo.ResponseVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

@Slf4j
@Component
public class ExecuteOrderServiceApiFeignApiFallback implements ExecuteOrderServiceFeignApi {

    @Override
    public ResponseVO chooseSendOrderHttp(@RequestBody OperateBotReqDTO operateBotReqDTO, @RequestParam(value = "systemInnerType") Integer systemInnerType) {
        log.warn("请求处理异常，触发熔断，请注意查看，chooseSendOrderHttp={}", (null != operateBotReqDTO ? JSON.toJSONString(operateBotReqDTO) : ""));
        return null;
    }

    @Override
    public ResponseVO toSetOpenOrderAmount(@RequestBody OperateBotReqDTO operateBotReqDTO, @RequestParam(value = "amount") BigDecimal amount) {
        log.warn("请求处理异常，触发熔断，请注意查看，toSetOpenOrderAmount={}", (null != operateBotReqDTO ? JSON.toJSONString(operateBotReqDTO) : ""));
        return null;
    }

}
